package com.foxzzz.bit;


public class Solution231 {
    public boolean isPowerOfTwo(int n) {
        return (n > 0) && (n & -n) == n;
    }

    public static void main(String[] args) {
        System.out.println(new Solution231().isPowerOfTwo(1));
        System.out.println(new Solution231().isPowerOfTwo(2));
        System.out.println(new Solution231().isPowerOfTwo(16));
        System.out.println(new Solution231().isPowerOfTwo(218));
    }
}
